package net.anzhuo.common.utils;

import javax.servlet.http.HttpServletRequest;

public class AjaxUtil {

	public static boolean isAjax(HttpServletRequest request) {
		if ((request.getHeader("accept").indexOf("application/json") > -1) || (request.getHeader("X-Requested-With") != null && request.getHeader("X-Requested-With").indexOf("XMLHttpRequest") > -1)) {
			return true;
		} else {
			return false;
		}
	}
}
